﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace StateManager
{
    // i still have to understand what's going on in this part of the code
    // since it's not used yet, ill leave this without comments yet
    class Animation
    {
        Texture2D texture;
        float frameTime;


        bool isLooping;

        public Texture2D Texture
        {
            get { return texture; }
        }

        int pxlYOffset = 0;
        public int PxlYOffset
        {
            get { return pxlYOffset; }
        }

        int pxlOffset;
        public int PxlOffset
        {
            get { return pxlOffset; }
        }

        public bool IsLooping
        {
            get { return isLooping; }
        }

        public int FrameCount
        { get { return texture.Width / FrameWidth; } }

        public float FrameTime
        {
            get { return frameTime; }
        }

        int frameWidth;
        public int FrameWidth { get { return frameWidth; } }
        //public int FrameWidth { get { return (texture.Height / 6) * 10; } }

        public int FrameHeight { get { return texture.Height; } }

        public Animation(Texture2D givenTex, float givenTime, bool loopInfo, int width, int offSet)
        {
            texture = givenTex;
            frameTime = givenTime;
            isLooping = loopInfo;
            frameWidth = width;
            pxlOffset = offSet;
        }

        public Animation(Texture2D givenTex, float givenTime, bool loopInfo, int width, int offSet, int yOffSet)
            : this(givenTex, givenTime, loopInfo, width, offSet)
        {
            pxlYOffset = yOffSet;
        }
    }
}
